package io.babystar.modules.business.dao;

import io.babystar.modules.business.entity.ShopEntity;
import io.babystar.modules.business.entity.StudentEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.babystar.modules.business.entity.StudentEntityAll;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 
 * 
 * @author jeson
 * @email 574197743@qq.com
 * @date 2021-03-23 20:03:33
 */
@Mapper
public interface StudentDao extends BaseMapper<StudentEntity> {


    /**
     * 获取预约信息
     * @return
     */
    List<Map<String,Object>> getAppointmentInfo(Map<String, Object> map);

    int getAppointmentCount(Map<String, Object> map);

    /**
     * 排序分页查询
     * @return
     */
    List<StudentEntityAll> queryPageStudentToSort(Map<String, Object> map);

    /**
     * 分页重写
     * @param map
     * @return
     */
    List<StudentEntityAll> queryPageStudent(Map<String, Object> map);

    int queryPageStudentCount(Map<String, Object> map);


    /**
     * 查询获取机构下的店铺信息
     * @param trainId
     * @return
     */
    List<ShopEntity> getShopInfo(@Param("trainId") Long trainId, @Param("shopId") Integer shopId);

    /**
     * 查询需要签到的学生
     * @param map
     * @return
     */
    List<Map<String,Object>> getSignStudent(Map<String, String> map);


    List<Map<String,Object>> getStudentByShopId(Map<String, String> map);

    /**
     * 校对家长手机号重复性
     * @param matherphone
     * @returnselectCount
     */
    Integer queryPhone(@Param("matherphone") Long matherphone, @Param("id") Integer id);

    Integer queryMemberNum(Integer memberNum);

    List<StudentEntityAll> queryPageStudentSchoolCountList(Map<String, Object> map);
    List<StudentEntityAll> queryPageStudentAddressCountList(Map<String, Object> map);
    List<StudentEntityAll> queryPageStudentPaymentSumList(Map<String, Object> map);
    List<StudentEntityAll> selectClassEeliminationRateList(Map<String, Object> map);
    List<StudentEntityAll> selectStudentPaymentRecordsList(Map<String, Object> map);

    Integer selectStudentSchoolCountListCount(Map<String, Object> map);
    Integer selectStudentAddressCountListCount(Map<String, Object> map);
    Integer selectStudentPaymentSumCount(Map<String, Object> map);
    Integer selectClassEeliminationRateCount(Map<String, Object> map);
    Integer selectStudentPaymentRecordsCount(Map<String, Object> map);
}
